package cn.bdqn.mallmgr.pojo;

import java.util.List;

/**
 * @author 分页
 * @create 2022-07-12 9:05
 */
public class Page {
    private Integer index;
    private Integer size;
    private Integer count;
    private Integer total;
    private List list;

    public Integer getIndex() {
        return index;
    }

    public void setIndex(Integer index) {
        index = index > total ? total : index;
        index = index < 1 ? 1 : index;
        this.index = index;
    }

    public Integer getSize() {
        return size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
        total = count % size == 0 ? count / size : count / size + 1;
    }

    public Integer getTotal() {
        return total;
    }

    public List getList() {
        return list;
    }

    public void setList(List list) {
        this.list = list;
    }
}
